<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets">

    <p:panel styleClass="imgHeader generalInputFormPanel" rendered="#{managerView.activePanel == 'NEW_TASK'}">
        <f:facet name="header">
            <h:graphicImage library="images" name="task-16.png" style="margin-bottom: 1px;margin-top: 1px;" />
            <h:outputText styleClass="title" value="#{msg['managerPage.taskManagement.newTask.title']}" />
        </f:facet>

        <h:panelGroup id="editTaskPanel" layout="block" styleClass="inputDataFields">
            <table>
                <tr>
                    <td class="label"><h:outputText value="#{msg['managerPage.taskManagement.name']}" /></td>
                    <td class="value">
                        <p:inputText id="taskName" value="#{taskManager.newOrModifiedTaskBean.name}" required="true" requiredMessage="#{msg['managerPage.taskManagement.name.requiredMsg']}" />
                        <p:message for="taskName" />
                    </td>
                </tr>
                <tr>
                    <td class="value" colspan="2">
                        <h:outputText value="#{msg['managerPage.taskManagement.description']}" /><br />
                        <p:inputTextarea value="#{taskManager.newOrModifiedTaskBean.description}" />
                    </td>
                </tr>
                <tr>
                    <td class="label"><h:outputText value="#{msg['managerPage.taskManagement.section']}" /></td>
                    <td class="value">
                        <p:selectOneMenu id="section" value="#{taskManager.newOrModifiedTaskBean.section.sectionId}"
                                         required="true" requiredMessage="#{msg['managerPage.taskManagement.section.requiredMsg']}">
                            <f:selectItem itemLabel="#{msg['managerPage.taskManagement.section.selectOne']}" itemValue="#{null}" />
                            <f:selectItems value="#{taskManager.availableSections}" var="section" itemLabel="#{section.sectionName}" itemValue="#{section.sectionId}" />
                        </p:selectOneMenu>
                        <p:message for="section" />
                    </td>
                </tr>
            </table>
        </h:panelGroup>

        <p:commandButton value="#{msg['Common.save']}" action="#{taskManager.save}" icon="save" update="@form" rendered="#{taskManager.newOrModifiedTaskBean.taskId == null}" />
        <p:commandButton value="#{msg['Common.update']}" action="#{taskManager.save}" icon="save" update="@form" rendered="#{taskManager.newOrModifiedTaskBean.taskId != null}" />
        <p:commandButton value="#{msg['Common.cancel']}" action="#{managerView.switchPanel('DESCRIPTION')}" update="@form" icon="cancel" process="@this" >
            <f:actionListener type="org.omnifaces.eventlistener.ResetInputAjaxActionListener"/>
        </p:commandButton>
    </p:panel>
</ui:composition>